//
//  HomePageMainTableViewCell.m
//  STL_ Animation
//
//  Created by DJtd on 16/3/31.
//  Copyright © 2016年 STL. All rights reserved.
//

#import "HomePageMainTableViewCell.h"
#import "STL.h"

@implementation HomePageMainTableViewCell



        

   

- (void)setHomeModel:(HomePageBaseModel *)homeModel {
    _homeModel = homeModel;
    
    [self.backImage sd_setImageWithURL:[NSURL URLWithString:homeModel.posterPic] placeholderImage:[UIImage imageNamed:@"homePlace"]];
    self.title.text = homeModel.title;
    self.desc.text = homeModel.descriptionModel;
}



- (void)awakeFromNib {
    [super awakeFromNib];

    

    self.layerName = [CAGradientLayer layer];
    
    self.layerName.startPoint = CGPointMake(0, 0);
    self.layerName.endPoint = CGPointMake(0, 1);
    self.layerName.colors = @[(__bridge id)[UIColor clearColor].CGColor,(__bridge id)[UIColor blackColor].CGColor];
    self.layerName.locations = @[@(0.5f),@(1.0f)];

    [self.contentView.layer addSublayer:self.layerName];
    
    [self.contentView bringSubviewToFront:self.title];
    [self.contentView bringSubviewToFront:self.desc];
    [self.contentView bringSubviewToFront:self.typeImage];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.layerName.frame = CGRectMake(0, 0, BoundsWidth, BoundsHeight);

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
